\(\int \sqrt {a+b \sec (c+d x)} \tan (c+d x) \, dx\) [320]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 51 \[ \int \sqrt {a+b \sec (c+d x)} \tan (c+d x) \, dx=-\frac {2 \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {2 \sqrt {a+b \sec (c+d x)}}{d} \]

[Out]

-2*arctanh((a+b*sec(d*x+c))^(1/2)/a^(1/2))*a^(1/2)/d+2*(a+b*sec(d*x+c))^(1/2)/d

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3970, 52, 65, 213} \[ \int \sqrt {a+b \sec (c+d x)} \tan (c+d x) \, dx=\frac {2 \sqrt {a+b \sec (c+d x)}}{d}-\frac {2 \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a}}\right )}{d} \]

[In]

Int[Sqrt[a + b*Sec[c + d*x]]*Tan[c + d*x],x]

[Out]

(-2*Sqrt[a]*ArcTanh[Sqrt[a + b*Sec[c + d*x]]/Sqrt[a]])/d + (2*Sqrt[a + b*Sec[c + d*x]])/d

Rule 52

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + n + 1))), x] + Dist[n*((b*c - a*d)/(b*(m + n + 1))), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 3970

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[-(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[(b^2 - x^2)^((m - 1)/2)*((a + x)^n/x), x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\sqrt {a+x}}{x} \, dx,x,b \sec (c+d x)\right )}{d} \\ & = \frac {2 \sqrt {a+b \sec (c+d x)}}{d}+\frac {a \text {Subst}\left (\int \frac {1}{x \sqrt {a+x}} \, dx,x,b \sec (c+d x)\right )}{d} \\ & = \frac {2 \sqrt {a+b \sec (c+d x)}}{d}+\frac {(2 a) \text {Subst}\left (\int \frac {1}{-a+x^2} \, dx,x,\sqrt {a+b \sec (c+d x)}\right )}{d} \\ & = -\frac {2 \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {2 \sqrt {a+b \sec (c+d x)}}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.96 \[ \int \sqrt {a+b \sec (c+d x)} \tan (c+d x) \, dx=\frac {-2 \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a}}\right )+2 \sqrt {a+b \sec (c+d x)}}{d} \]

[In]

Integrate[Sqrt[a + b*Sec[c + d*x]]*Tan[c + d*x],x]

[Out]

(-2*Sqrt[a]*ArcTanh[Sqrt[a + b*Sec[c + d*x]]/Sqrt[a]] + 2*Sqrt[a + b*Sec[c + d*x]])/d

Maple [A] (verified)

Time = 0.66 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.82

method result size
derivativedivides \(\frac {2 \sqrt {a +b \sec \left (d x +c \right )}-2 \sqrt {a}\, \operatorname {arctanh}\left (\frac {\sqrt {a +b \sec \left (d x +c \right )}}{\sqrt {a}}\right )}{d}\) \(42\)
default \(\frac {2 \sqrt {a +b \sec \left (d x +c \right )}-2 \sqrt {a}\, \operatorname {arctanh}\left (\frac {\sqrt {a +b \sec \left (d x +c \right )}}{\sqrt {a}}\right )}{d}\) \(42\)

[In]

int((a+b*sec(d*x+c))^(1/2)*tan(d*x+c),x,method=_RETURNVERBOSE)

[Out]

1/d*(2*(a+b*sec(d*x+c))^(1/2)-2*a^(1/2)*arctanh((a+b*sec(d*x+c))^(1/2)/a^(1/2)))

Fricas [A] (verification not implemented)

none

Time = 0.43 (sec) , antiderivative size = 192, normalized size of antiderivative = 3.76 \[ \int \sqrt {a+b \sec (c+d x)} \tan (c+d x) \, dx=\left [\frac {\sqrt {a} \log \left (-8 \, a^{2} \cos \left (d x + c\right )^{2} - 8 \, a b \cos \left (d x + c\right ) - b^{2} + 4 \, {\left (2 \, a \cos \left (d x + c\right )^{2} + b \cos \left (d x + c\right )\right )} \sqrt {a} \sqrt {\frac {a \cos \left (d x + c\right ) + b}{\cos \left (d x + c\right )}}\right ) + 4 \, \sqrt {\frac {a \cos \left (d x + c\right ) + b}{\cos \left (d x + c\right )}}}{2 \, d}, \frac {\sqrt {-a} \arctan \left (\frac {2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + b}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{2 \, a \cos \left (d x + c\right ) + b}\right ) + 2 \, \sqrt {\frac {a \cos \left (d x + c\right ) + b}{\cos \left (d x + c\right )}}}{d}\right ] \]

[In]

integrate((a+b*sec(d*x+c))^(1/2)*tan(d*x+c),x, algorithm="fricas")

[Out]

[1/2*(sqrt(a)*log(-8*a^2*cos(d*x + c)^2 - 8*a*b*cos(d*x + c) - b^2 + 4*(2*a*cos(d*x + c)^2 + b*cos(d*x + c))*s
qrt(a)*sqrt((a*cos(d*x + c) + b)/cos(d*x + c))) + 4*sqrt((a*cos(d*x + c) + b)/cos(d*x + c)))/d, (sqrt(-a)*arct
an(2*sqrt(-a)*sqrt((a*cos(d*x + c) + b)/cos(d*x + c))*cos(d*x + c)/(2*a*cos(d*x + c) + b)) + 2*sqrt((a*cos(d*x
 + c) + b)/cos(d*x + c)))/d]

Sympy [F]

\[ \int \sqrt {a+b \sec (c+d x)} \tan (c+d x) \, dx=\int \sqrt {a + b \sec {\left (c + d x \right )}} \tan {\left (c + d x \right )}\, dx \]

[In]

integrate((a+b*sec(d*x+c))**(1/2)*tan(d*x+c),x)

[Out]

Integral(sqrt(a + b*sec(c + d*x))*tan(c + d*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.31 \[ \int \sqrt {a+b \sec (c+d x)} \tan (c+d x) \, dx=\frac {\sqrt {a} \log \left (\frac {\sqrt {a + \frac {b}{\cos \left (d x + c\right )}} - \sqrt {a}}{\sqrt {a + \frac {b}{\cos \left (d x + c\right )}} + \sqrt {a}}\right ) + 2 \, \sqrt {a + \frac {b}{\cos \left (d x + c\right )}}}{d} \]

[In]

integrate((a+b*sec(d*x+c))^(1/2)*tan(d*x+c),x, algorithm="maxima")

[Out]

(sqrt(a)*log((sqrt(a + b/cos(d*x + c)) - sqrt(a))/(sqrt(a + b/cos(d*x + c)) + sqrt(a))) + 2*sqrt(a + b/cos(d*x
 + c)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 185 vs. \(2 (43) = 86\).

Time = 0.40 (sec) , antiderivative size = 185, normalized size of antiderivative = 3.63 \[ \int \sqrt {a+b \sec (c+d x)} \tan (c+d x) \, dx=\frac {2 \, {\left (\frac {a \arctan \left (-\frac {\sqrt {a - b} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b} + \sqrt {a - b}}{2 \, \sqrt {-a}}\right )}{\sqrt {-a}} - \frac {2 \, b}{\sqrt {a - b} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b} - \sqrt {a - b}}\right )} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}{d} \]

[In]

integrate((a+b*sec(d*x+c))^(1/2)*tan(d*x+c),x, algorithm="giac")

[Out]

2*(a*arctan(-1/2*(sqrt(a - b)*tan(1/2*d*x + 1/2*c)^2 - sqrt(a*tan(1/2*d*x + 1/2*c)^4 - b*tan(1/2*d*x + 1/2*c)^
4 - 2*a*tan(1/2*d*x + 1/2*c)^2 + a + b) + sqrt(a - b))/sqrt(-a))/sqrt(-a) - 2*b/(sqrt(a - b)*tan(1/2*d*x + 1/2
*c)^2 - sqrt(a*tan(1/2*d*x + 1/2*c)^4 - b*tan(1/2*d*x + 1/2*c)^4 - 2*a*tan(1/2*d*x + 1/2*c)^2 + a + b) - sqrt(
a - b)))*sgn(cos(d*x + c))/d

Mupad [B] (verification not implemented)

Time = 13.72 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.92 \[ \int \sqrt {a+b \sec (c+d x)} \tan (c+d x) \, dx=\frac {2\,\sqrt {a+\frac {b}{\cos \left (c+d\,x\right )}}}{d}-\frac {2\,\sqrt {a}\,\mathrm {atanh}\left (\frac {\sqrt {a+\frac {b}{\cos \left (c+d\,x\right )}}}{\sqrt {a}}\right )}{d} \]

[In]

int(tan(c + d*x)*(a + b/cos(c + d*x))^(1/2),x)

[Out]

(2*(a + b/cos(c + d*x))^(1/2))/d - (2*a^(1/2)*atanh((a + b/cos(c + d*x))^(1/2)/a^(1/2)))/d